package com.td.module.equipment.dal.mysql.waterpump;

import java.util.*;

import com.td.framework.common.pojo.PageResult;
import com.td.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.td.framework.mybatis.core.mapper.BaseMapperX;
import com.td.module.equipment.dal.dataobject.waterpump.PumpDO;
import org.apache.ibatis.annotations.Mapper;
import com.td.module.equipment.controller.admin.waterpump.vo.*;

/**
 * 水泵信息 Mapper
 *
 * @author 王翔翔
 */
@Mapper
public interface PumpMapper extends BaseMapperX<PumpDO> {

    default PageResult<PumpDO> selectPage(PumpPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PumpDO>()
                .likeIfPresent(PumpDO::getName, reqVO.getName())
                .eqIfPresent(PumpDO::getSerialNum, reqVO.getSerialNum())
                .eqIfPresent(PumpDO::getValveValue, reqVO.getValveValue())
                .eqIfPresent(PumpDO::getOnline, reqVO.getOnline())
                .betweenIfPresent(PumpDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PumpDO::getId));
    }

}
